package com.lzlclass.http._Schedul;


import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class ScheduledService {

//    定时的规则
        @Scheduled(cron = "0 0 0/3 * * ?")
        public void showTime(){
            System.out.println(new SimpleDateFormat("YYYY/MM/dd HH:mm:ss").format(new Date()));
        }


}
